// WorkSchedulerDlg.h : header file
//

#pragma once
#include "WorkSchedulingLogic.h"

class CSimpleTray;

// CWorkSchedulerDlg dialog
class CWorkSchedulerDlg : public CDialog
{
// Construction
public:
	CWorkSchedulerDlg(CWnd* pParent = NULL);	// standard constructor
	~CWorkSchedulerDlg();

// Dialog Data
	enum { IDD = IDD_WORKSCHEDULER_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedBtnStartWork();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg long OnTrayNotify(WPARAM wParam, LPARAM lParam);
	afx_msg void OnShowWS();
	afx_msg void OnExit();
	afx_msg void OnStopWork();
	afx_msg void OnOpenPreferences();
	afx_msg void OnOpenReport();
	afx_msg void OnOpenAboutDlg();

private:
	void UpdateControlsState();	
	void MinimizeToTray(bool bMinimize);	
	CString GetRemainingTimeString(const CTimeSpan& remainingTimeSpan);
	CString GetSystrayString();


	CSimpleTray * m_pTray;
	WorkSchedulingLogic m_WorkSchedulingLogic;
	UINT_PTR m_uiTimerWork;
	bool m_bMinimized;
	bool m_bFiredPopup;
public:
	afx_msg void OnBnClickedToSystray();
	//void OnCancel(){MinimizeToTray(true);};
	void OnOK(){OnBnClickedBtnStartWork();};
};
